﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ViewStudent.aspx.cs" Inherits="ExamAnalysis.View.ViewStudent" %>
<%@ Register src="~/Controls/DropDownSchoolList.ascx" tagname="DropDownSchoolList" tagprefix="uc" %>
<%@ Register src="~/Controls/DropDownClassList.ascx" tagname="DropDownClassList" tagprefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <span>选择学校：</span>
        <uc:DropDownSchoolList ID="SchoolList" runat="server" 
            OnSelectedSchoolChanged="SchoolList_SelectedSchoolChanged" />
    </p>
    <p>
        <span>选择班级：</span>
        <uc:DropDownClassList ID="ClassList" runat="server" 
            OnSelectedClassChanged="ClassList_SelectedClassChanged" />
    </p>

    <asp:GridView ID="GridView" runat="server" AllowSorting="True" Width="500px" 
        AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" 
        BorderStyle="Solid" BorderWidth="1px" CellPadding="3" 
        ForeColor="Black" GridLines="Horizontal" DataSourceID="LinqDataSource" >
        <Columns>
            <asp:BoundField DataField="StudentID" HeaderText="标识" 
            InsertVisible="False" ReadOnly="True" SortExpression="StudentID" />
            <asp:BoundField DataField="StudentCode" HeaderText="学号" 
                SortExpression="StudentCode" />
            <asp:BoundField DataField="StudentName" HeaderText="姓名" 
                SortExpression="StudentName" />
            <asp:BoundField DataField="Sex" HeaderText="性别" 
                SortExpression="Sex" />
            <asp:BoundField DataField="StudentType" HeaderText="学生类型" 
                SortExpression="StudentType" />
            <asp:BoundField DataField="IsValid" HeaderText="活动状态" 
                SortExpression="IsValid" />
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="Black" Height="30" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <RowStyle Height="30" />
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource" runat="server" 
        ContextTypeName="ExamAnalysis.Model.ExamAnalysisDataContext" EntityTypeName="" 
        TableName="StudentInfo" Where="ClassID == @ClassID">
        <WhereParameters>
            <asp:ControlParameter ControlID="ClassList" Name="ClassID" 
                PropertyName="ClassID" Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
</asp:Content>
